package cn.zeronineten;

import java.util.ArrayList;

/*
@李子宁
Happy,happy everyday!
冲鸭！
2020/9/16

*/
public class Main {

    public static void main(String[] args) {
       
    }
    public static void getSize(String[] s){
        String res = "";
        res +=s[0]+"#";
        ArrayList<String> list = new ArrayList<>();
        list.add(res);
        for (int i = 1; i < s.length; i++) {
            String tmp = s[i] + "#";
            if (isContains(list,tmp)){
               continue;
            }else {
                list.add(tmp);
            }
        }
        String r = "";
        for (String s1 : list) {
            r += s1;
        }
        System.out.println(r.length());
    }
    public static boolean isContains(ArrayList<String> list,String s){
        for (int i = 0; i < list.size(); i++) {
            if (isContains(list.get(i),s)){
                if (s.length()>list.get(i).length()){
                    list.remove(i);
                    list.add(s);
                    return true;
                }
                return true;
            }else {
                return false;
            }
        }
        return false;
    }

    public static boolean isContains(String s1,String s2){
        return s1.endsWith(s2) || s2.endsWith(s1);
    }
}
